<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
    <title>jbgallery 3.0 demo - advanced - push hundreds photos from picasa</title>
    <meta name="author" content="Massimiliano Balestrieri" />
    <link href="../../jbgallery-3.0.css" rel="stylesheet" media="screen" />
    <script src="../../libs/jquery-1.4.4.min.js" type="text/javascript"></script>
    <script src="../../jbgallery-3.0.js" type="text/javascript"></script>
    <script type="text/javascript"><!--
    jQuery(document).ready(function(){
		
		var _jbg = jQuery("#hundred").jbgallery({
			menu : 'slider',
			slideshow : true,
			style : "zoom",
			ready : function(){
				_picasa();
			}
		}, true);
        

		function _picasa(){
			
			var _account = 'massimiliano.balestrieri';
			var _url = 'http://picasaweb.google.com/data/feed/base/user/' + _account + '?kind=album&alt=rss&hl=en_US&access=public';
			$.getJSON("http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20rss%20where%20url%3D'" +
			encodeURIComponent(_url) +
			"'&format=json&callback=?", function(data){
				var _tot = data.query.results.item.length;
				$.each(data.query.results.item, function(i, d){
					var _u = d.content || d.guid.content;
					var _u2 = _u.replace("entry", "feed") + '&kind=photo';
					var _last = _tot == (i + 1);
					
					//if(i < 2)
					$.getJSON("http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20rss%20where%20url%3D'" +
					encodeURIComponent(_u2) +
					"'&format=json&callback=?", function(data){
						var _images = [];
						var _res = data.query.results.item;
						$.each(_res, function(i2, d2){
							_images.push({
								href: d2.enclosure.url,
								caption: d2.description,
								thumb : $(d2.description).find("img").attr("src") || d.enclosure.url
							});
							if ((i2 + 1) == _res.length) {
								_jbg.push(_images);//_jbg.push(_images);
							}
						});
						
						
					});
					
				});
				
			});
		}
	});
	--></script>
	<style type="text/css">
        .jbg-caption *{color:#fff}
        .jbg-caption img{display:none;}
    </style>
    </head>    
<body>
<div class="jbgallery" id="hundred">
	<ul>
        <li><a title="gundam1" href="http://lh3.ggpht.com/_JJJpzXdPAI4/SpzuamwkzII/AAAAAAAABOM/j3HnzPk5VnU/100_2768.jpg">1</a></li>
    </ul>
</div>
<script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-258871-1']);
  _gaq.push(['_setDomainName','.maxb.net']); 
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
</script>
</body>
</html>